package com.design.command.remotecontrol1;

public class CommandPatternDemo {
    public static void main(String[] args) {
        RemoteControl remoteControl = new RemoteControl();

        TV tv = new TV();
        Stereo stereo = new Stereo();

        Command tvOnCommand = new TVOnCommand(tv);
        Command tvOffCommand = new TVOffCommand(tv);

        Command stereoOnCommand = new StereoOnCommand(stereo);
        Command stereoOffCommand = new StereoOffCommand(stereo);

        remoteControl.setCommand(0, tvOnCommand, tvOffCommand);
        remoteControl.setCommand(1, stereoOnCommand, stereoOffCommand);

        remoteControl.pressOnButton(0); // Turn on TV
        remoteControl.pressOffButton(0); // Turn off TV
        remoteControl.pressOnButton(1); // Turn on Stereo
        remoteControl.pressOffButton(1); // Turn off Stereo
    }
}
